package app

import (
	"gin-demo/pkg/e"
	"github.com/gin-gonic/gin"
)

// AuthorLanguage .
type AuthorLanguage string

// language
const (
	AuthorLanguageCn AuthorLanguage = "zh" // 中文
	AuthorLanguageEn AuthorLanguage = "en" // 英文
)

// GetAuthorLanguage .
func GetAuthorLanguage(ctx *gin.Context) AuthorLanguage {
	return AuthorLanguage(ctx.GetHeader(e.AuthorLanguage))
}

// String .
func (s AuthorLanguage) String() string {
	return string(s)
}
